/*     */ package com.wgcloud.controller;
/*     */ 
/*     */ import com.github.pagehelper.PageInfo;
/*     */ import com.wgcloud.entity.DbTableCount;
/*     */ import com.wgcloud.service.DbInfoService;
/*     */ import com.wgcloud.service.DbTableCountService;
/*     */ import com.wgcloud.service.DbTableService;
/*     */ import com.wgcloud.service.LogInfoService;
/*     */ import com.wgcloud.util.PageUtil;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ import javax.annotation.Resource;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import org.apache.commons.lang3.StringUtils;
/*     */ import org.slf4j.Logger;
/*     */ import org.slf4j.LoggerFactory;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.ui.Model;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/dbTableCount"})
/*     */ public class DbTableCountController
/*     */ {
/*  37 */   private static final Logger logger = LoggerFactory.getLogger(com.wgcloud.controller.DbTableCountController.class);
/*     */ 
/*     */   
/*     */   @Resource
/*     */   private DbInfoService dbInfoService;
/*     */ 
/*     */   
/*     */   @Resource
/*     */   private DbTableService dbTableService;
/*     */ 
/*     */   
/*     */   @Resource
/*     */   private DbTableCountService dbTableCountService;
/*     */ 
/*     */   
/*     */   @Resource
/*     */   private LogInfoService logInfoService;
/*     */ 
/*     */   
/*     */   @RequestMapping({"list"})
/*     */   public String dbTableCountList(DbTableCount dbTableCount, Model model) {
/*  58 */     Map<String, Object> params = new HashMap<>();
/*     */     try {
/*  60 */       PageInfo pageInfo = this.dbTableCountService.selectByParams(params, dbTableCount.getPage().intValue(), dbTableCount.getPageSize().intValue());
/*  61 */       PageUtil.initPageNumber(pageInfo, model);
/*  62 */       model.addAttribute("pageUrl", "/dbTableCount/list?1=1");
/*  63 */       model.addAttribute("page", pageInfo);
/*  64 */     } catch (Exception e) {
/*  65 */       logger.error("查询数据源表统计信息错误", e);
/*  66 */       this.logInfoService.save("查询数据源表统计信息错误", e.toString(), "1");
/*     */     } 
/*     */     
/*  69 */     return "dbTableCount/list";
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @RequestMapping({"save"})
/*     */   public String saveDbTableCount(DbTableCount dbTableCount, Model model, HttpServletRequest request) {
/*     */     try {
/*  84 */       this.dbTableCountService.save(dbTableCount);
/*  85 */     } catch (Exception e) {
/*  86 */       logger.error("保存数据源表统计错误：", e);
/*  87 */       this.logInfoService.save("保存数据源表统计错误", e.toString(), "1");
/*     */     } 
/*  89 */     return "redirect:/dbTableCount/list";
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @RequestMapping({"del"})
/*     */   public String delete(Model model, HttpServletRequest request, RedirectAttributes redirectAttributes) {
/* 104 */     String errorMsg = "删除数据源表统计信息错误";
/* 105 */     DbTableCount DbTableCount = new DbTableCount();
/*     */     try {
/* 107 */       if (!StringUtils.isEmpty(request.getParameter("id"))) {
/* 108 */         DbTableCount = this.dbTableCountService.selectById(request.getParameter("id"));
/* 109 */         this.dbTableCountService.deleteById(request.getParameter("id").split(","));
/*     */       } 
/* 111 */     } catch (Exception e) {
/* 112 */       logger.error(errorMsg, e);
/* 113 */       this.logInfoService.save(errorMsg, e.toString(), "1");
/*     */     } 
/*     */     
/* 116 */     return "redirect:/dbTableCount/list";
/*     */   }
/*     */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/controller/DbTableCountController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */